local pianxi = fk.CreateSkill{
  name = "hanqing__pianxi",
}

Fk:loadTranslationTable{
  ["hanqing__pianxi"] = "偏袭",
  [":hanqing__pianxi"] = "出牌阶段限一次，你可以明置任意张手牌并视为使用【火攻】，若其展示牌与你弃置牌明暗置状态不同，此牌伤害+1。",

  ["#hanqing__pianxi"] = "偏袭：你可以明置任意张手牌，视为使用【火攻】",
}

local DIY = require "packages/diy_utility/diy_utility"

pianxi:addEffect("viewas", {
  anim_type = "offensive",
  mute_card = false,
  prompt = "#hanqing__pianxi",
  card_filter = function(self, player, to_select, selected)
    return table.contains(player:getCardIds("h"), to_select) and
      not table.contains(DIY.getShownCards(player), to_select)
  end,
  view_as = function(self, player, cards)
    if #cards == 0 then return end
    local card = Fk:cloneCard("fire_attack")
    card.skillName = pianxi.name
    card:addFakeSubcards(cards)
    return card
  end,
  before_use = function (self, player, use)
    DIY.showCards(player, use.card.fake_subcards)
    local card = use.card:clone()
    local c = table.simpleClone(use.card)
    for k, v in pairs(c) do
      card[k] = v
    end
    card.skill = Fk.skills["hanqing__pianxi__fire_attack_skill"]
    use.card = card
  end,
  enabled_at_play = function (self, player)
    return player:usedSkillTimes(pianxi.name, Player.HistoryPhase) == 0
  end,
})

pianxi:addAI(nil, "vs_skill")

return pianxi
